package com.foreknow.demo10;

public class TypeConvert {

    public void m1(double money) {
        System.out.println(money);
    }

    public double m2() {
        return 1;
    }

    public void m3(Pet p) {
        System.out.println(p.getName());
    }

    public Pet m4() {
        Dog dog = new Dog();
        dog.setName("xx");
        return dog;
    }


    public static void main(String[] args) {
        TypeConvert convert = new TypeConvert();
        convert.m1(1);
        double d = convert.m2();
        System.out.println(d);

        Dog dog = new Dog();
        dog.setName("大黄");
        convert.m3(dog);

        Pet pet = convert.m4(); //pet=Dog;
        System.out.println(pet.getName());
    }
}
